//
//  MovieDetailsViewController.m
//  UI豆瓣2015到2016跨年作业
//
//  Created by LHY on 16/1/5.
//  Copyright © 2016年 Lanou 32 李昊宇. All rights reserved.
//

#import "MovieDetailsViewController.h"
#import "ModelMovie.h"
#import "UIImageView+WebCache.h"
@interface MovieDetailsViewController ()

@property (nonatomic , retain) NSMutableArray *arrModel;


@end

@implementation MovieDetailsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    UIScrollView *scroll = [[UIScrollView alloc] initWithFrame:self.view.frame];
    scroll.contentSize = CGSizeMake(0, self.view.frame.size.height);
    
    [self.view addSubview:scroll];
    [scroll release];
    
    NSString *path = [[NSBundle mainBundle] pathForResource:@"movie" ofType:@"plist"];
    NSArray *arr = [NSArray arrayWithContentsOfFile:path];
    self.arrModel = [NSMutableArray array];
    for (NSDictionary *dic in arr) {
        ModelMovie *mod = [ModelMovie modelMovie];
        [mod setValuesForKeysWithDictionary:dic];
        [_arrModel addObject:mod];
        
    }

    self.view.backgroundColor = [UIColor whiteColor];
    
    UIImageView *image = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 100, 150)];
    
    ModelMovie *mod = _arrModel[_index.row];
    [image sd_setImageWithURL:[NSURL URLWithString:mod.image]];
    
    [scroll addSubview:image];
    
    
}






- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
